VERSION 5.00
Begin VB.Form Main 
   Caption         =   "Morse Converter"
   ClientHeight    =   6360
   ClientLeft      =   120
   ClientTop       =   450
   ClientWidth     =   6390
   LinkTopic       =   "Form1"
   ScaleHeight     =   6360
   ScaleWidth      =   6390
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton convert 
      Caption         =   "Convert!"
      Height          =   375
      Left            =   2040
      TabIndex        =   4
      Top             =   5880
      Width           =   2175
   End
   Begin VB.TextBox morsetext 
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   162
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1935
      Left            =   360
      MousePointer    =   2  'Cross
      MultiLine       =   -1  'True
      TabIndex        =   3
      Top             =   3840
      Width           =   5655
   End
   Begin VB.TextBox text 
      Height          =   2655
      Left            =   360
      MultiLine       =   -1  'True
      TabIndex        =   1
      Text            =   "Main.frx":0000
      Top             =   480
      Width           =   5655
   End
   Begin VB.Label morselabel 
      Caption         =   "Morse Code:"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   3360
      Width           =   1455
   End
   Begin VB.Label txtlabel 
      Caption         =   "Text:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1815
   End
End
Attribute VB_Name = "Main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub convert_Click()
If morsetext.text = vbNullString Then
For i = 1 To Len(text.text)
chrs = Mid(text.text, i, 1)
convertit (chrs)
Next
Else
morsetext.text = ""
End If
End Sub
Function convertit(ByVal inner)
Dim special As String
special = " "
Dim converter As String
Select Case inner
Case "a"
converter = ".-"
Case "b"
converter = "-..."
Case "c"
converter = "-.-."
Case "d"
converter = "-.."
Case "e"
converter = "."
Case "f"
converter = "..-."
Case "g"
converter = "--."
Case "h"
converter = "...."
Case "i"
converter = ".."
Case "j"
converter = ".---"
Case "k"
converter = "-.-"
Case "l"
converter = ".-.."
Case "m"
converter = "--"
Case "n"
converter = "-."
Case "o"
converter = "---"
Case "p"
converter = ".--."
Case "q"
converter = "--.-"
Case "r"
converter = ".-."
Case "s"
converter = "..."
Case "t"
converter = "-"
Case "u"
converter = "..-"
Case "v"
converter = "...-"
Case "w"
converter = ".--"
Case "x"
converter = "-..-"
Case "y"
converter = "-.--"
Case "z"
converter = "--.."
Case "0"
converter = "-----"
Case "1"
converter = ".----"
Case "2"
converter = "..---"
Case "3"
converter = "...--"
Case "4"
converter = "....-"
Case "5"
converter = "....."
Case "6"
converter = "-...."
Case "7"
converter = "--..."
Case "8"
converter = "---.."
Case "9"
converter = "----."
Case "."
converter = ".-.-.-"
Case ","
converter = "--..--"
End Select
Dim output As String
output = morsetext.text
If Not morsetext.text = vbNullString Then
morsetext.text = output + special + converter
Else
morsetext.text = output + converter
End If
End Function
